UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2aqT4X0dZRTdpwdUQtsYSuqyrGBYyg/3IFO8dKjO848=' 
WHERE 
  key_id = '3bcaa7ef36e014c1ac9bb6fb8e21b93925af693d8c1db854f4e4a4500aeb0605' 
  AND (
    token = '2aqT4X0dZRTdpwdUQtsYSuqyrGBYyg/3IFO8dKjO848=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032