UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RQv39bNRBEEK3XcUq4+A16GLwdJDXProv4wAfLB3024=' 
WHERE 
  key_id = '07e9f838699a8860c382f068bc265ae2125e4d46ed5418d672c2cb4e2f3db3e2' 
  AND (
    token = 'RQv39bNRBEEK3XcUq4+A16GLwdJDXProv4wAfLB3024=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068