UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3N4ld2zCZiL0W9AF+y4YzLtGTG3WgSvyp4Ar5VE9Njk=' 
WHERE 
  key_id = '5dcd28418c69eeeff04396604e4fde62f7e91fe167410cb2c750626c3bcda2ca' 
  AND (
    token = '3N4ld2zCZiL0W9AF+y4YzLtGTG3WgSvyp4Ar5VE9Njk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058