UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9qcyRfb+5eOsLo3v5I758AFEpo6BR2pKX1XN9ULplnM=' 
WHERE 
  key_id = 'acaefe9cf4f786bbebd8a9f0ac042bbc81823f4b44b422fd7bf026d5726d3f5b' 
  AND (
    token = '9qcyRfb+5eOsLo3v5I758AFEpo6BR2pKX1XN9ULplnM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036