UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AtWDuvkgm9tVABJlr2iKI8uVSMHxJc/OZ7QKMz8GKJE=' 
WHERE 
  key_id = '2e8228330dcad6daaa1add49fa3909c6e563f25bad657b90143493b16380700d' 
  AND (
    token = 'AtWDuvkgm9tVABJlr2iKI8uVSMHxJc/OZ7QKMz8GKJE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031