UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JvMBaJLJWr+zgbvdVgH3wc0KddbpjeV6fh8vyJ9tgnI=' 
WHERE 
  key_id = '8c82d6dfe43e4d78e30dcad276721c4ec7ec5efc206efd4dcda303289cd9d9ba' 
  AND (
    token = 'JvMBaJLJWr+zgbvdVgH3wc0KddbpjeV6fh8vyJ9tgnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031