UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IDNNSv78hdyLj3lbKGq1i7aMOaDNRpwEd0OD/OdmTuI=' 
WHERE 
  key_id = '2d8068625accdb00ccf41dcd2319d269ee22c4e1f672e7ad9a3b4a16dbe9e360' 
  AND (
    token = 'IDNNSv78hdyLj3lbKGq1i7aMOaDNRpwEd0OD/OdmTuI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037