UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Su7oZQiSCas+9Y0mVk9XSTTQ/sMl2Guec1eFtykCDZQ=' 
WHERE 
  key_id = 'ad6ad7a3bba59f1c46b8e411a8035d9a8d255138b4f3c3e5b223ab02d8129a2c' 
  AND (
    token = 'Su7oZQiSCas+9Y0mVk9XSTTQ/sMl2Guec1eFtykCDZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027