UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QNbsDupKgaQPhCdEqJ1lyd2UppZfpCkFP22Oj2BWTMs=' 
WHERE 
  key_id = 'e6808cdb2ea665b87d5d87e4198b506b812d9c072a0904bb4daff50ea107c044' 
  AND (
    token = 'QNbsDupKgaQPhCdEqJ1lyd2UppZfpCkFP22Oj2BWTMs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037