UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v1vIbuayTSvTsmLlfVOP0uir7XEb7k++gkF1Vb7IIdA=' 
WHERE 
  key_id = '4d6d0a369cf89e3c49f7477dbf6211f56899ff57fe0df8fad05aebd0edd3bc04' 
  AND (
    token = 'v1vIbuayTSvTsmLlfVOP0uir7XEb7k++gkF1Vb7IIdA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037