UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y+MNHMi6BEGnPNOH5DdwMDA0RVGpH3F+xn/+hVQe5Mc=' 
WHERE 
  key_id = '6e98cba1a3375c46292641fab8d95408081835a4b99b7883027c6839e95a05c9' 
  AND (
    token = 'y+MNHMi6BEGnPNOH5DdwMDA0RVGpH3F+xn/+hVQe5Mc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059