UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AWE629dEfa1ez71CPCkoo7aKDeZpmUFNqFg2dzmINFA=' 
WHERE 
  key_id = '85cb066ad1657c93a48b3e55c22c24e20483a970f5f79ef3b51add55fbd405c7' 
  AND (
    token = 'AWE629dEfa1ez71CPCkoo7aKDeZpmUFNqFg2dzmINFA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069