UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8wP5HbdzGDOHfakLKY7yFnbXIU4eBHxuKsDZ9pQxc4Y=' 
WHERE 
  key_id = '64fb4cf1308973ba1f6147c1b61ada21eb1fa824cf4a5bebad7639a4641fe86c' 
  AND (
    token = '8wP5HbdzGDOHfakLKY7yFnbXIU4eBHxuKsDZ9pQxc4Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048