UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OSk9AMS5+CpBP9Ygx3wwb1XhCBO1DOyZT4KKDUed3JA=' 
WHERE 
  key_id = 'a03dd4239bb0992b85682e21e6a268c48c4c646d7305b1611f704c3144d4332b' 
  AND (
    token = 'OSk9AMS5+CpBP9Ygx3wwb1XhCBO1DOyZT4KKDUed3JA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033