UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nwGKhcihMjV4A3g1j2Ed+N22k+p/BSk6ZHGm8EFF9eE=' 
WHERE 
  key_id = 'c3489a23ba82a62eff11e1ef6d948003bd35960ac1de1cbb3aeeab1836d34a05' 
  AND (
    token = 'nwGKhcihMjV4A3g1j2Ed+N22k+p/BSk6ZHGm8EFF9eE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048