UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'daX5qbtdwbGfqzuYlaFrRtB/zZC6kMkrTpKkquiVi/8=' 
WHERE 
  key_id = 'e8b79170486d0de95a60beb33e8a8705897349fdb18aa799e986e824b50bce80' 
  AND (
    token = 'daX5qbtdwbGfqzuYlaFrRtB/zZC6kMkrTpKkquiVi/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020