UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OLIDjFeMBJhWEuw/At73if5j2KPkIyuoMu4MDHnP4ow=' 
WHERE 
  key_id = '2df00d3853b0cc81ffff09828ce1760e63f7feb37744cda6160d6887242fb1d2' 
  AND (
    token = 'OLIDjFeMBJhWEuw/At73if5j2KPkIyuoMu4MDHnP4ow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013