UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PUuwtf6f+6ZPyai2EHzp8UhnRceOwSOlD+fubmrl60I=' 
WHERE 
  key_id = '7438d9c903621df0e427115cee91d621575b9aae7177ea0d2d33e7a46677a166' 
  AND (
    token = 'PUuwtf6f+6ZPyai2EHzp8UhnRceOwSOlD+fubmrl60I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072