UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '74CHIekYO3MLUuhst2fDutIixu3oK4i5SDa3Xuu31A4=' 
WHERE 
  key_id = 'cc8d357d7aa1576f23b0d8f296d1a6cdddc582b6fdfffe64f2761160e7601e24' 
  AND (
    token = '74CHIekYO3MLUuhst2fDutIixu3oK4i5SDa3Xuu31A4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036