UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xO11ILPzR/GfYTzhUhwlgK6GQh/DA/0ua9Ae/AXOZ58=' 
WHERE 
  key_id = '44c6fc9021b1b878544b4e9cdeac97cd1360ffc0d4d2644b691825b77861ec6a' 
  AND (
    token = 'xO11ILPzR/GfYTzhUhwlgK6GQh/DA/0ua9Ae/AXOZ58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030