UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MavC7GNnjf/zyheC0pBdmeUDfnVqkiCGNsoEWKMVsok=' 
WHERE 
  key_id = '8fdc16e59437b5874bd58f3fb55540d751449320105e3021dcaa7c6de7ea1d71' 
  AND (
    token = 'MavC7GNnjf/zyheC0pBdmeUDfnVqkiCGNsoEWKMVsok=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028