UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IzcIluktvrQjJszk/lwtWtnrsErcwhomMHj0OydyR14=' 
WHERE 
  key_id = 'b0728592d080c8025382a8c65d7b41ef70efaf5decfe96cc7c310fb413134d96' 
  AND (
    token = 'IzcIluktvrQjJszk/lwtWtnrsErcwhomMHj0OydyR14=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031