UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KKLK9C1bwU7q6lmBuraXyfXU3ZUDSk18SYhJsWXGHzQ=' 
WHERE 
  key_id = '4b6c569a887584fcd2b756f4198c32a2a7e6418ee131734bf703b919694c76b9' 
  AND (
    token = 'KKLK9C1bwU7q6lmBuraXyfXU3ZUDSk18SYhJsWXGHzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050