UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pV5pBnmrPjah6w8AfFqFfrPbVCMtbh6cuuw/q2gXAlM=' 
WHERE 
  key_id = 'c0b85268ad28ca0e9eca18f8a0f15f54ca1702615546e4ac4edca73182b85a5c' 
  AND (
    token = 'pV5pBnmrPjah6w8AfFqFfrPbVCMtbh6cuuw/q2gXAlM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039