UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jAGfDEKnTepNNiFSZNEfKYUSr5ez+YfM5QRCpqIynic=' 
WHERE 
  key_id = '60e64570c1090d2c5a291b59c080cfea0dc7bd927ab9a6b9d52163c6f89e1ea7' 
  AND (
    token = 'jAGfDEKnTepNNiFSZNEfKYUSr5ez+YfM5QRCpqIynic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038