UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FzMJa1loE2xMJxl/psUyMCFRiAZlhA+o4x1zcuig8Sg=' 
WHERE 
  key_id = '839dba1778bb795d64ef0b2bfe32a0bc8bb3ef9d23a231d6ff573ed651856920' 
  AND (
    token = 'FzMJa1loE2xMJxl/psUyMCFRiAZlhA+o4x1zcuig8Sg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030