UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J0FN0P6N8mFxpU0GenBYu0Equ7+c6Ydy6FAS0U/G63c=' 
WHERE 
  key_id = '3aac53c50163bbe80dd04d108f3139ce33931c5cc41704fb88ce736ae93f9d51' 
  AND (
    token = 'J0FN0P6N8mFxpU0GenBYu0Equ7+c6Ydy6FAS0U/G63c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032