UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ln9R+gy565KrlxACb8au9uLybNIwIaKyEtELMkNZk1c=' 
WHERE 
  key_id = '8d573bf80938cdcd54851ea2e68aa6190f9d343aedc396f652bf6f6dd1cca355' 
  AND (
    token = 'ln9R+gy565KrlxACb8au9uLybNIwIaKyEtELMkNZk1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029