UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DByVxRfVo2aeXykYH7oDFqXy5RjwG65L+sRDlEG6SPs=' 
WHERE 
  key_id = 'e7a9d6c14d0ef0768fe17150319d67c5eb002aed739c0817a80c53060d906ef7' 
  AND (
    token = 'DByVxRfVo2aeXykYH7oDFqXy5RjwG65L+sRDlEG6SPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067