UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mz9rG+vTU5SQVQH25RkWehK9Ne1uULS/+Bu/8ZcT++M=' 
WHERE 
  key_id = 'df7858643c4af79cd7c17b38d006cb64fdf638f4c971b80eb3af6eb21b41e8d0' 
  AND (
    token = 'Mz9rG+vTU5SQVQH25RkWehK9Ne1uULS/+Bu/8ZcT++M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029