UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zi7G6vMIUERF9SF8uPs70yjDY1ZCvSKw+dYxDViC2sw=' 
WHERE 
  key_id = '6cd84953b9400943ce36115fc12d34414f18f7d65c5decbb7dd631667f84d276' 
  AND (
    token = 'zi7G6vMIUERF9SF8uPs70yjDY1ZCvSKw+dYxDViC2sw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036