UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DHWN6g4fYixuZ//ryVbg0TW1BMpa4urX6TkzcyURhvE=' 
WHERE 
  key_id = 'be5613d7ef25724e36ee23ab25eac39e05a18b151ad04e256bb80b48cae2777f' 
  AND (
    token = 'DHWN6g4fYixuZ//ryVbg0TW1BMpa4urX6TkzcyURhvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030