UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BAHCCaGBa/wglVQnYMQbk+UOs3x66kdYtVz+jdiySEw=' 
WHERE 
  key_id = '353ad4f3e60429ac89224f3f6846ea410c26367af31830bdb9ed08e0a415deee' 
  AND (
    token = 'BAHCCaGBa/wglVQnYMQbk+UOs3x66kdYtVz+jdiySEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020