UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5XSp2hZSp1/uBHQiGDStq0e55iQtaA7izLOL4QSrXys=' 
WHERE 
  key_id = 'ddc8f26057ddfbf8b29e9c73e97ee94bee79d0a3c208a9155ef8f55d4db54603' 
  AND (
    token = '5XSp2hZSp1/uBHQiGDStq0e55iQtaA7izLOL4QSrXys=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032